<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本水平对齐的思考</title>
    <style>
        .nav{
            /* text-align是给块级元素设置的属性
            设置之后块级元素内部的文本会水平居中 */
           text-align: center;
            width: 500px;
            height: 200px;
            background-color: skyblue;
        }
       
    </style>
</head>
<body>
    <div class="nav">
        <span>天南地北双飞客，老翅几回寒暑</span>
    </div>
</body>
</html>